﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/HRManagerUI/HrManager.Master"
    AutoEventWireup="true" CodeBehind="ConfigPunishment.aspx.cs" Inherits="HRM.UI.HRManagerUI.PunishmentUI.ConfigPunishment" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentBody" runat="server">
    <link href="../../../Styles/Punishment/ConfigPunishement.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
        function CheckField() {
            if (document.getElementById("<%=txtProcedure.ClientID%>").value == "") {
                document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Punished Procedure Name!";
                document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                document.getElementById("<%=txtProcedure.ClientID%>").focus();
                return false;
            }

            return true;
        }
        function CheckValueField() {
            var abc = document.getElementById("<%=txtPunishmentType.ClientID%>").value;

            if (abc.length == 0) {
                document.getElementById("<%=msgLbl.ClientID%>").textContent = "Please Enter Punishment Type";
                document.getElementById("<%=msgLbl.ClientID%>").style.color = "red";
                document.getElementById("<%=txtPunishmentType.ClientID%>").focus();
                return false;
            }

            return true;
        }
    </script>
    <fieldset>
        <legend>Add Punishment Procedure</legend>
        <table class="AddPunishTB">
            <tr>
                <td style="width: 60%" align="center">
                    <fieldset>
                        <legend>Add New Procedure</legend>
                        <table style="width: 100%">
                            <tr>
                                <td colspan="2" align="center">
                                    <asp:Label runat="server" ID="msgLabel" CssClass="msgTxt"></asp:Label>
                                    <hr />
                                </td>
                            </tr>
                            <tr>
                                <td class="Label">
                                    Procedure Name:
                                </td>
                                <td class="Field">
                                    <input type="text" runat="server" id="txtProcedure" class="inputTextarea" /><span
                                        class="estaricStar">*</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="Label">
                                    Procedure Details:
                                </td>
                                <td class="Field">
                                    <textarea cols="30" rows="3" id="txtProcedureDetails" runat="server" class="inputTextarea"></textarea>
                                </td>
                            </tr>
                            <tr>
                                <td class="Label">
                                </td>
                                <td class="Field">
                                    <input type="submit" onserverclick="SavePunishedProcedure" runat="server" id="addPproject"
                                        value="Save" class="btnCss" onclick="return CheckField()" />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
                <td>
                    <div id="PunishDiv">
                        Punishment Procedure<br />
                        <div align="center">
                            <asp:Label runat="server" ID="Lblpunishpro"></asp:Label>
                        </div>
                        <hr />
                        <asp:GridView runat="server" ID="punishedProcedureGdv" AutoGenerateColumns="False"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" CssClass="GridviewStyle"
                            Width="100%" AllowPaging="True" PageSize="5" OnPageIndexChanging="punishedProcedureGdv_PageIndexChanging"
                            OnRowDeleting="punishedProcedureGdv_RowDeleting">
                            <Columns>
                                <asp:TemplateField HeaderText="Id" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="lblid" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Procedure" HeaderText="Punished Procedure Law" />
                                <asp:TemplateField HeaderText="Delete">
                                    <ItemTemplate>
                                        <asp:LinkButton runat="server" ID="linkRemove" CommandArgument='<%# Bind("Id")%>'
                                            CommandName="Delete" Text="Delete" OnClientClick="return confirm('Do you want to delete this Punished Procedure?')">
                                        </asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle CssClass="GridViewFooterStyle" />
                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                            <PagerStyle HorizontalAlign="Center" CssClass="GridViewFooterStyle" />
                            <RowStyle ForeColor="#000066" />
                            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                            <SortedAscendingCellStyle BackColor="#F1F1F1" />
                            <SortedAscendingHeaderStyle BackColor="#007DBB" />
                            <SortedDescendingCellStyle BackColor="#CAC9C9" />
                            <SortedDescendingHeaderStyle BackColor="#00547E" />
                        </asp:GridView>
                    </div>
                </td>
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend>Configure Punished Type</legend>
        <table width="100%">
            <tr>
                <td style="width: 60%" align="center">
                    <fieldset>
                        <legend>Add New Punishment</legend>
                        <table width="80%">
                            <tr>
                                <td colspan="2" align="center">
                                    <asp:Label runat="server" ID="msgLbl"></asp:Label>
                                    <hr />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Punishment Name:
                                </td>
                                <td align="left">
                                    <input type="text" runat="server" id="txtPunishmentType" class="textboxinput" /><span
                                        class="estaricStar">*</span>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                </td>
                                <td align="left">
                                    <input type="submit" runat="server" id="btnSave" value="Save" class="btnCss" onclick=" return CheckValueField()"
                                        onserverclick="SavePunishmentType" />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
                <td align="left">
                    Punsihment Type
                    <div align="center">
                        <asp:Label runat="server" ID="LblPunishType"></asp:Label></div>
                    <hr />
                    <asp:GridView runat="server" ID="punishedTypeGdv" AutoGenerateColumns="False" BorderColor="#CCCCCC"
                        BorderStyle="None" BorderWidth="1px" CellPadding="3" Width="100%" AllowPaging="True"
                        PageSize="5" OnPageIndexChanging="punishedTypeGdv_PageIndexChanging" CssClass="GridviewStyle"
                        OnRowDeleting="punishedTypeGdv_RowDeleting">
                        <Columns>
                            <asp:TemplateField HeaderText="Id" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblId" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Type" HeaderText="Punishment Name" />
                            <asp:TemplateField HeaderText="Delete">
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ID="linkRemove" CommandArgument='<%# Bind("Id")%>'
                                        CommandName="Delete" Text="Delete" OnClientClick="return confirm('Do you want to delete this Punished Type?')">
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                        <PagerStyle CssClass="GridViewFooterStyle" HorizontalAlign="center" />
                        <RowStyle ForeColor="#000066" />
                        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#F1F1F1" />
                        <SortedAscendingHeaderStyle BackColor="#007DBB" />
                        <SortedDescendingCellStyle BackColor="#CAC9C9" />
                        <SortedDescendingHeaderStyle BackColor="#00547E" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </fieldset>
</asp:Content>
